class P637_39643 {

    static int[] multiples = { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48,
            52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100 };

    public static void main(String[] args) {

        while (true) {
           
            int i = Integer.parseInt(readLn());
           
            if (i == 0) break;
           
            int sheets = getNumberOfSheets(i);
       
            int counter = 1;
            System.out.println("Printing order for " + i + " pages:") ;
            for (int k = 0; k < sheets/4; k++) {
                System.out.println("Sheet " + counter + ", front: " + (sheets - (k*2) - 1 >= i ? "Blank" : sheets - (k*2) + "") + ", " + ((k * 2) + 1));
                if (k * 2+1 < i)
                	System.out.println("Sheet " + counter + ", back : " + (k * 2 + 2) + ", " + (sheets - (k*2) - 2 >= i ? "Blank" : sheets - (k*2) - 1 + ""));
                counter++;
            }
           
        }
    }

    private static int getNumberOfSheets(int i) {
        for (int k = 0; k < multiples.length; k++) {
            if (i <= multiples[k]) return multiples[k];
        }
        return 100;
    }

    static String readLn() {
        String newLine = System.getProperty("line.separator");
        StringBuffer buffer = new StringBuffer();
        int car = -1;
        try {
            car = System.in.read();
            while ((car > 0) && (car != newLine.charAt(0))) {
                buffer.append((char) car);
                car = System.in.read();
            }
            if (car == newLine.charAt(0))
                System.in.skip(newLine.length() - 1);
        } catch (java.io.IOException e) {
            return (null);
        }
        if ((car < 0) && (buffer.length() == 0))
            return (null);
        return (buffer.toString()).trim();
    }

}